<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		
	</body>
	<script>
		function sendHttpRequest(url, method, data) {
		  return new Promise((resolve, reject) => {
		    const xhr = new XMLHttpRequest();
		    xhr.open(method, url, true);
		    xhr.setRequestHeader('Content-Type', 'application/json');
		 
		    xhr.onload = function() {
		      if (xhr.status >= 200 && xhr.status < 300) {
		        resolve(xhr.responseText);
		      } else {
		        reject(new Error(xhr.statusText));
		      }
		    };
		 
		    xhr.onerror = function() {
		      reject(new Error("Network Error"));
		    };
		 
		    xhr.send(data);
		  });
		};
		
		sendHttpRequest("https://bff.gds.org.cn/gds/searching-api/ProductService/ProductListByGTIN?PageSize=30&PageIndex=1&SearchItem=06901294179158", "GET").then(response => {
		  console.log(response);
		}).catch(error => {
		  console.error(error);
		});
	</script>
</html>
